package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.QguaranteeMapper;
import com.youlai.boot.system.model.QB.Qguarantee;
import com.youlai.boot.system.service.QguaranteeSevice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class QguaranteeServiceImpl extends ServiceImpl<QguaranteeMapper, Qguarantee> implements QguaranteeSevice {

    @Autowired
    private QguaranteeMapper qguaranteeMapper;

    @Override
    public boolean saveQguarantee(Qguarantee qguarantee) {
        qguarantee.setAddtime(LocalDateTime.now());
        return save(qguarantee);
    }

    @Override
    public List<Qguarantee> getAllQguarantee() {
        return qguaranteeMapper.selectList(null);
    }

    @Override
    public boolean deleteQguaranteeById(Integer id) {
        return qguaranteeMapper.deleteById(id) >0;
    }
}
